<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" href="/statics/plugins/bootstrap-3.4.1-dist/css/bootstrap.min.css"
          integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <style>
        .loginForm {
            /*边框高度*/
            height: 350px;
            /*边框宽度*/
            width: 500px;
            /*边框颜色*/
            border: #4d4d4d solid 1px;
            /*边框圆角*/
            border-radius: 4px;
            /*阴影 水平方向，竖直方向，模糊距离*/
            box-shadow: 5px 5px 5px #4d4d4d;
            /*上边界距离*/
            margin-top: 300px;
            /*左边界距离：自动*/
            margin-left: auto;
            /*右边界距离：自动*/
            margin-right: auto;
            /*用户名、密码间距*/
            padding: 20px 40px;
        }

        /*将用户登录置于中间*/
        .loginForm h2 {
            text-align: center;
        }

        /*修改button属性*/
        .button {
            text-align: center;
            vertical-align: middle;
        }
    </style>
</head>
<body>
    {% if error %}
        <script type="text/javascript">
            var error = "{{ error }}";
            alert(error);
        </script>
    {% endif %}
<div class="loginForm">
    <h2>用户登录</h2>
    <form action="/login/" method="post">
        {% csrf_token %}
        <div class="form-group">
            <label for="exampleInputName">用户名</label>
            <input type="text" class="form-control" name="username" placeholder="请输入用户名" value="{{ username }}">
        </div>
        <div class="form-group">
            <label for="exampleInputPassword">密码</label>
            <input type="password" class="form-control" name="password" placeholder="请输入密码" value="{{ password }}">
        </div>
        <div class="checkbox">
            <label>
                <input type="checkbox"> 同意
                <a href="#">&nbsp;&nbsp;&nbsp;&nbsp;xxx安全协议</a> 与 <a href="#">&nbsp;&nbsp;&nbsp;&nbsp;xxx隐私协议</a>
                <br>
                <input type="checkbox" name="isSaved"> 记住用户名
            </label>
        </div>
        <div class="button">
            <input type="submit" class="btn btn-primary" value="登 录"/>
        </div>
    </form>
</div>

</body>
</html>
